<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>生成汇缴订单</title>
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="0">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../gjjhbj/fy.js"></script>
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>

<link rel="stylesheet" href="../../../css/font_eolqem241z66flxr.css"
	media="all" />
<link rel="stylesheet" href="../../../css/news.css" media="all" />
<script type="text/javascript" src="../../../layui/layui/GetPath.js"></script>
<body class="childrenBody">

	<!-- 邮件发送 -->
	<div class="sysNotice col">
		<blockquote class="layui-elem-quote title">添加补缴人员信息</blockquote>
		<table class="layui-table">
			<colgroup>
				<col width="10%" style="min-width:100px">
				<col width="20%">
				<col width="10%" style="min-width:100px">
				<col width="50%">
			</colgroup>
		</table>
	</div>

<div ng-app="myApp" ng-controller="customersCtrl" align="center">
<Loading></Loading>

	<div class="layui-form-item">
		<li class="layui-inline" >
			<label class="layui-form-label">姓名:</label>
			
				<div class="layui-input-inline">
					<span
						style="margin-left:115px;width:18px;overflow:hidden;height: 30px;">
						<select style="width:190px;margin-left:-115px;height: 38px;"
						id="xl" ng-model="XINGMING" ng-change="ch()"
						ng-selected="mySel()">
							<option ng-repeat="x in names" value="{{x.XINGMING}}">{{x.XINGMING}}|{{x.GRZH}}|{{x.ZJHM}}</option>
					</select> </span> <input id="_input" type="text"
						style="width:170px;position:absolute;left:0px;height:34px;"
						ng-change="cx($index)" ng-model="XM" >
						</div>
		</li>
		<div class="layui-inline"  >
			<label class="layui-form-label">证件号码:</label>
			<div class="layui-input-inline">
				<input type="text" readonly="readonly" ng-model="ZJHM"
					id="GRJCJS" autocomplete="off" class="layui-input"  style="width:101%">
			</div>
		</div>
		<div class="layui-inline"  >
			<label class="layui-form-label">补缴原因:</label>
			<div class="layui-input-inline">
				<input type="text"  ng-model="BZ"  
					id="GRJCJS" autocomplete="off" class="layui-input"  style="width:101%">
			</div>
		</div>
	</div>
	
		<div class="layui-form-item">
	    <div class="layui-inline" align="left">
 		<label class="layui-form-label" style="width: 80px">补缴年月:</label>
	      <div class="layui-input-inline" align="left">
	        <input class="layui-input" id="test8" placeholder="请选择年月" type="text"   readonly="readonly" ng-model="BJNY">
	      </div>
	      </div>
	      <div class="layui-inline">
			<label class="layui-form-label">个人账号:</label>
				<div class="layui-input-inline">
					<input type="text" readonly="readonly" ng-model="GRZH" id="GRJCJS"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
			<label class="layui-form-label">补缴金额:</label>
			<div class="layui-input-inline">
				<input type="text"  ng-model="BJJE" 
					id="GRJCJS" autocomplete="off" class="layui-input">
			</div>
		</div>

		
		
	</div>
		<button class="layui-btn " ng-click="others.saveContact()">保存</button>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  </fieldset>
		
		<div>
			<div class="layui-inline" align="center">
	      <label class="layui-form-label" style="width: 80px" >证件号码:</label>
	      <div class="layui-input-inline">
	        <input class="layui-input" type="text" ng-model="zjc">
	      </div>
	       </div>
	       <div class="layui-inline" align="center">
	       <label class="layui-form-label" style="width: 80px" >姓名:</label>
	      <div class="layui-input-inline">
	        <input class="layui-input" type="text" ng-model="xm">
	      </div>
	      </div>
	        <input ng-click="chaxun()" type="button" class="layui-btn layui-btn-primary" value="查询已录入人员">
	   
				<table class="layui-table" style="width:100%;">
					<tr align="center" style="background-color:#f1f1f1">
						<td ng-show=false>当前行数</td>
						<td>补缴年月</td>
						<td>补缴金额</td>
						<td>姓名</td>
						<td>身份证号码</td>
						<td>状态</td>
					</tr>
					<tr ng-repeat="x in names1" align="center">
						<td ng-if="$odd" ng-show=false style="background-color:#f1f1f1">{{
							$index+1 }}</td>
						<td ng-if="$even" ng-show=false>{{ $index+1 }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							x.NY }}</td>
						<td ng-if="$even">{{ x.NY }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right">{{ x.BJE| currency:"" 
							}}</td>
						<td ng-if="$even" style="text-align:right">{{ x.BJE| currency:""  }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							x.XINGMING }}</td>
						<td ng-if="$even">{{ x.XINGMING }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">{{
							x.ZJHM }}</td>
						<td ng-if="$even">{{ x.ZJHM }}</td>
						<td ng-if="$odd" style="background-color:#f1f1f1">等待审核</td>
						<td ng-if="$even">等待审核</td>
					</tr>
				</table>
			
			<div class="layui-btn-group">
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Sy()">首页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Previous()">上一页</button>
				<button ng-repeat="page in pageList"
					class="layui-btn layui-btn-primary layui-btn-sm "
					ng-click="selectPage(page)">{{page}}</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Next()">下一页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm"
					ng-click="Wy()">尾页</button>
				<button class="layui-btn layui-btn-primary layui-btn-sm ">{{selPage}}/{{pages}}</button>
			</div>
			</div>
<script>

	var app = angular.module('myApp', []);
		 app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
		    
		     	layui.use('layer', function(){
  var layer = layui.layer;
  
});       
		    app.controller('customersCtrl', function($scope, $http) { 
		     $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
		     $scope.setLoading();
		    $http({
				url:getPath() + "/wsyyt/bjgncontroller/lr",
				contentType:"text/html;charset=utf-8",
				method:'post',
				async:false,
				params:{ZJHM:$scope.zjc}
			}).then(
					function(res) {
					 $scope.setLoading();
					 $scope.names1=res.data.data;
					 data=res.data.data;
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
								 $scope.pageSize = 20;//设置显示行数
	 
    $scope.pages = Math.ceil(data.length / $scope.pageSize); //分页数
    $scope.newPages = $scope.pages > 5 ? 5 : $scope.pages;
    $scope.pageList = [];
    $scope.selPage = 1;
    //设置表格数据源(分页)
    $scope.setData= function () {
      $scope.names1 = data.slice(($scope.pageSize * ($scope.selPage - 1)), ($scope.selPage * $scope.pageSize));//通过当前页数筛选出表格当前显示数据
    }
    $scope.names1 = data.slice(0, $scope.pageSize);
    //分页要repeat的数组
    for (var i = 0; i < $scope.newPages; i++) {
      $scope.pageList.push(i + 1);
    }
    //打印当前选中页索引
    $scope.selectPage = function (page) {
    
      //不能小于1大于最大
      if (page < 1 || page > $scope.pages) return;
    
      //最多显示分页数5
      if (page >2) {
        //因为只显示5个页数，大于2页开始分页转换
        var newpageList = [];
        for (var i = (page - 3) ; i < ((page + 2) > $scope.pages ? $scope.pages : (page + 2)) ; i++) {
          newpageList.push(i + 1);
        }
        $scope.pageList = newpageList;
      }else if (page ==1||page==2) {
        var newpageList = [];
        if($scope.pages>5){
        for (var i = 1 ; i < 6; i++) {
          newpageList.push(i);
        }
        }
        else{
        	for (var i = 1 ; i < $scope.pages+1; i++) {
                newpageList.push(i);
              }
        	
        }
        $scope.pageList = newpageList;
      }else{
       for (var i = 1 ; i < $scope.pages2+1; i++) {
          newpageList.push(i);
        }
        $scope.pageList = newpageList;
      };
      $scope.selPage = page;
      $scope.setData();
      $scope.isActivePage(page);
      console.log("选择的页:" + page);
    };
    //设置当前选中页样式
    $scope.isActivePage = function (page) {
      return $scope.selPage == page;
    };
    //上一页
    $scope.Previous = function () {
      $scope.selectPage($scope.selPage - 1);
    }
    //下一页
    $scope.Next = function () {
      $scope.selectPage($scope.selPage + 1);
      var a;
    };
      $scope.Sy = function () {
      $scope.selectPage(1);
    };
      $scope.Wy = function () {
      $scope.selectPage( $scope.pages);
    };
	
								 
						});
		    
		        var k;
		    $scope.mySel=function(){
		     var selectValue = $('#xl option:selected').text();//选中select的内容
       //alert("selectValue" + selectValue);
       		if(selectValue!=null&&selectValue!="")
     			$scope.XM=selectValue;
		
		    for(var i=0;i<$scope.names.length;i++){
		    	if($scope.XINGMING==$scope.names[i].XINGMING){
		    	k=i;
		    	}
		    	}
		    	$scope.ZJHM=$scope.names[k].ZJHM,
		    	$scope.GRZH=$scope.names[k].GRZH
		    };
			
		    $scope.chaxun=function (){
		    $scope.setLoading();
					$http({
				url:getPath() + "/wsyyt/bjgncontroller/lr",
				contentType:"text/html;charset=utf-8",
				method:'post',
				async:false,
				params:{ZJHM:$scope.zjc,XINGMING:$scope.xm}
			}).then(
					function(res) {
					 $scope.setLoading();
					 $scope.names1=res.data.data;
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						});	    
		    }
			$scope.ch=aa();
			function aa(){
			   $scope.setLoading();
			   
	$http({
				url:getPath() + "/wsyyt/bjgncontroller/test2",
				contentType:"text/html;charset=utf-8",
				method:'post',
				async:false
			}).then(
					function(res) {
					 $scope.setLoading();
					 $scope.names=res.data.data;
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						$scope.data = res.data.data;//自己打断点看格式:[{},{}]
						a = res.data.CNT;
      
						});
						}
		$scope.cx=function (index){
		$scope.XINGMING=$scope.XM;
		 $scope.setLoading();
			$http({
				url:getPath() + "/wsyyt/bjgncontroller/test2",
				contentType:"text/html;charset=utf-8",
				method:'post',
				params:{XINGMING:$scope.XM}
			}).then(
					function(res) {
					 $scope.setLoading();
					 $scope.names=res.data.data;
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
						$scope.data = res.data.data;//自己打断点看格式:[{},{}]
						a = res.data.CNT;
      
						});
		}				
function getPath() {  
	    return 'http://'+location.host;
	}
 $scope.items=[];
 $scope.others={
 selectedItem:{},
 selected:function(item){
  this.selectedItem=item;
 },
 //增加
 addContact:function(){
  $scope.items.push({
  otherZJHM:'',
  otherContact:'',
  otherBusinessTel:'',
  otherMobPhone:'',
  otherQQ:'',
  otherSKYPE:'',
  otherEmail:'',
  otherDeliveryAddress:'',
  });
 },
  saveContact:function(){
  if($("#test8").val()==undefined||$("#test8").val()=="")
  {
  		layer.msg("请选择补缴年月");
  		return;
  
  }
  	if($scope.BJJE==undefined||$scope.BJJE=="")
  {
  		layer.msg("请填写补缴金额");
  		return;
  }
   	if($scope.BZ==undefined||$scope.BZ=="")
  {
  		layer.msg("请填写补缴原因");
  		return;
  }
   	if($scope.ZJHM==undefined||$scope.ZJHM=="")
  {
  		layer.msg("请填写证件号码");
  		return;
  }
   	if($scope.XM==undefined||$scope.XM=="")
  {
  		layer.msg("请填写姓名");
  		return;
  }
  if($scope.GRZH==undefined||$scope.GRZH=="")
  {
  		layer.msg("请填写个人账号");
  		return;
  }
   
  
  $scope.setLoading();
  	$http({
				url:getPath() +  "/wsyyt/bjgncontroller/test1",
				contentType:"text/html;charset=utf-8",
				method:'post',
				params:{XINGMING:$scope.XINGMING,GRZH:$scope.GRZH,ZJHM:$scope.ZJHM,BJNY:$("#test8").val(),BJJE:$scope.BJJE,BZ:$scope.BZ}
			}).then(
					function(res) {
					 $scope.setLoading();
					 $scope.names=res.data.data;
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
								 if(res.data.msg!='成功'){
								 console.info($scope.names);
							layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
								     setTimeout(function () {
										 window.location.reload();
									}, 1500);
								      
								     }
						     	else{
								     
								     layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 6    // icon
								     ,btn2:function(){
										
								     }});	
								         setTimeout(function () {
										 window.location.reload();
									}, 1500);
								     }
						$scope.data = res.data.data;//自己打断点看格式:[{},{}]
						a = res.data.CNT;
      
						});
 }
 }
})

</script>
<script type="text/javascript" src="../../../layui/layui/jquery-3.2.1.min.js"></script>
	<script type="text/javascript">
	layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  laydate.render({
	    elem: '#test8'
	    ,type: 'month'
	  });
	});
	$("#tclogin").click(function(){
		window.location.href='/wsyyt/login/login.html';
	});
	
	</script>
</body>
</html>